import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:package_info_plus/package_info_plus.dart';

class AppVersionService {
  final PackageInfo _info;

  AppVersionService(this._info);

  String get version => _info.version;
  String get buildNumber => _info.buildNumber;
  String get fullVersion => '$version ($buildNumber)';
}

final appVersionProvider = FutureProvider<AppVersionService>((ref) async {
  final info = await PackageInfo.fromPlatform();
  return AppVersionService(info);
});
